package com.fei.service;

import com.fei.bean.UserBean;
import com.fei.mapper.UserMapper;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    @Override
    public Boolean validPhoneService(String phone) {
        Integer num = userMapper.validPhone(phone);
        if(num == 0){
            return true;
        }
        return false;
    }

    @Override
    public Boolean validNameService(String userName) {
        Integer num = userMapper.validName(userName);
        if(num == 0){
            return true;
        }
        return false;
    }

    @Override
    public UserBean loginUserShiroService(String UserName) {
        return userMapper.loginUserShiro(UserName);
    }

    @Override
    public int registerUserService(UserBean bean) {
        return userMapper.registerUser(bean);
    }
}
